#include "gtest\gtest.h"
#include "datetime.h"

namespace nsbase = nsshare::base;

namespace
{

TEST(DateTimeTest, Generic)
{
    time_t tm_now;
    time(&tm_now);
    nsbase::DateTime dt1 = nsbase::DateTime::UTCNow();
    nsbase::DateTime dt2(dt1);
    nsbase::DateTime dt3 = dt2;
    EXPECT_EQ(true, dt1.ToUnixTime() == tm_now);
    EXPECT_EQ(true, dt2 == dt1); 
    EXPECT_EQ(true, dt3 == dt2);

    nsbase::DateTime dt4;
    nsbase::DateTime dt5;
    dt4.set_tick(1);
    dt5.set_tick(2);
    EXPECT_EQ(true, dt4 != dt5);
}

}